package com.syt.hospital.controller;

import com.syt.hospital.service.DepartmentService;
import com.syt.result.Result;
import com.syt.vo.hospital.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: xxx
 * @Date: 2023/2/16 19:55
 * @Description: 医院科室
 */
@Api(tags = "医院科室")
@RestController
@RequestMapping("/admin/hospital/department")
//@CrossOrigin 有 gateway 做了跨域
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("/getDepartmentList/{hoscode}")
    public Result getDepartmentList(@PathVariable String hoscode){
        List<DepartmentVo> list=departmentService.getDepartmentList(hoscode);
        return Result.ok(list);
    }

}
